//package com.baor.seacurity;
//
//
//import com.baor.dao.AdminDao;
//import com.baor.domain.AdminVo;
//import com.baor.domain.LoginUser;
//import com.baor.service.RoleService;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
//import org.springframework.stereotype.Service;
//
//import java.util.Objects;
//
//@Service
//public class UserDetailsServiceImpl implements UserDetailsService {
//
//    @Autowired
//    private AdminDao userDao;
//
//    @Autowired
//    private RoleService roleService;
//
//    private static final Logger log = LoggerFactory.getLogger(UserDetailsServiceImpl.class);
//
//    @Override
//    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
//        AdminVo vo = userDao.selectUserByUserName(username);
//        if (Objects.isNull(vo))
//        {
//            log.info("登录用户：{} 不存在.", username);
//            throw new RuntimeException("user.not.exists");
//        }
//        return new LoginUser(vo,null);
//    }
//
//}
